package com.cloudfun.campusshare.common.constant;

/**
 * @author : zhangyongjie
 * @version : 1.0
 * @createTime : 2020/5/11 9:32
 * @description : 工单状态
 */
public enum WorkerOrderStatus {
    ALL(-2,"全部"),
    WAIT_POINT(-1,"待指派"),
    WAIT_OFFER(0,"待领取"),
    IN_PROGRESS(1,"进行中"),
    BEYOND_TIME(2,"超期"),
    COMPLETE(3,"完成"),
    COMPLETE_BUT_NONFIX(4,"完成（未修复）");

    private int code;
    private String message;

    WorkerOrderStatus(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static WorkerOrderStatus getByCode(int code){
        WorkerOrderStatus[] values = WorkerOrderStatus.values();
        for(WorkerOrderStatus workerOrderStatus : values){
            if(workerOrderStatus.code == code){
                return workerOrderStatus;
            }
        }
        return null;
    }
}
